<?php 
// Header
$this->left_menu = "menu/manage_categories";

// Load CSS
echo $this->Html->css('manage_categories/add.css');
echo $this->Html->css('cake.form');

// Load Javascript
echo $this->Html->script('ckeditor/ckeditor_basic');
?>

<div class='right_content'>
<div class="title_left_sidebar">
	<div class="text_title">
		<?php __("Tạo mới danh mục")?>
	</div>
	<div class="create_edit">
		<div class="bd_title"></div>
		<div class="item_create">
			<div class="item_menu"><?php echo $html->image('toolbar/add.png', array('alt'=>__('List Of Categories',true), 'align'=>'left')) ?></div>
			<div class="category_mn"><a id='add_facility_link' href="<?php echo $html->url(array('controller'=>'manage_categories', 'action'	=>	'index'))?>"><?php __("List Of Categories")?></a></div>
			<div class="clear"></div>
		</div>
		<div class="bd_title"></div>
	</div>
</div>

<?php echo $session->flash()?>

<div class='cake_form'>
<?php 
echo $form->create('Category', array(
	'url'	=>	array(
		'controller'	=>	'manage_categories',	
		'action'		=>	'add'
	),
	'id'		=>	'add_category_form',
	'enctype'	=>	'multipart/form-data'
));

echo $form->input('name', array(
	'label'	=>	__("Tên: ", true),
	'error'	=>	__("Tên danh mục không được để trống", true)
));
echo $form->input('alias', array('label'	=>	__("Alias: ", true)));
echo $form->input('parent_id', array('label'	=>	__("Danh mục cha: ", true), 'options'	=>	$tree));

$options = array(
	//'name'				=>	$this->data['Article']['image'],
	'name'				=>	'',
	'path'				=>	'files/categories/',
	'field_name'		=>	'image',
	'label'				=>	__('Hình ảnh',true),
	'legend_title'		=>	__('Hình ảnh',true),
	//'delete_image_link'	=>	$html->url('/news/manage_news/delete_image/'.$this->data['Article']['id'])
	'delete_image_link'	=>	''
);
echo $html->form_image($options,array());
?>

<div class="input">
<table cellpadding='0' cellspacing='0' border='0' width='100%'>
<tr>
	<td class='label' valign='top'><?php __("Mô tả: ")?></td>
	<td>
		<?php
		echo $form->input('description', array('label'	=>	false, 'div'=>false)); 
		echo $wysiwyg->render('Category.description', 'ckeditor', array('uiColor'=>'#97da7f'));
		?>
	</td>
</tr>
</table>
</div>
<?php
echo $form->end(__('Tạo mới danh mục', true));
?>
</div>
</div>